
 function count_pi(n)
 n = input('请输入一个值')
 for(i=1:1:n)
     p(i) = 1/i^2;
 end
 b = sum(p);
 pi = sqrt(6*b);
 fprintf('pi的近似值为%.6f',pi)
 end
